package hu.mapro.gwtui.gxt.client.fieldseditor.field.function;

import com.google.common.base.Function;

import hu.mapro.gwtui.gxt.client.fieldseditor.field.EditorFieldInterface;
import hu.mapro.gwtui.gxt.client.fieldseditor.field.Interface;

public class Adapter<F> implements Interface<F> {

	Function<? super F, EditorFieldInterface<?>> function;
	
	@SuppressWarnings("unchecked")
	@Override
	public <V> EditorFieldInterface<V> createEditorField(F field) {
		return (EditorFieldInterface<V>) function.apply(field);
	}

	public Adapter(Function<? super F, EditorFieldInterface<?>> function) {
		super();
		this.function = function;
	}

}
